package com.ldu.exam.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 提交批改的试题
 * @author wenqing.liu
 *
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Builder
@Table(name="t_submitquestion")
public class SubmitQuestion 
{
	@Id
	@Column(length=32)
	@GeneratedValue(strategy = GenerationType.IDENTITY,generator = "jpa-uuid")
	@GenericGenerator(name = "jpa-uuid",strategy = "uuid.hex")
	private String id;
	
	private String content;
	
	/**
	 * 标准答案
	 */
	private String answer;
	
	/**
	 * 提交答案
	 */
	private String submitAnswer;
	
	/**
	 * 标准分数
	 */
	private String score;
	
	
	@OneToOne
	@JoinColumn(name="type")
	private QuestionTypeModel questionType;
	/**
	 * 0未批改2已批改
	 */
	private String isCorrected;
	
	@ManyToOne
	@JoinColumn(name="questionId")
	@JsonIgnoreProperties("questions")
	private SubmitPaper submitPaper;
	

}
